package com.zyz.L_泛型.通配符;

import java.util.ArrayList;
import java.util.Collection;

/**
 * @author: vick
 * @Date: 2025/4/2
 * @Description:
 * @version: 1.0
 */
public class Demo2 {
    public static void main(String[] args) {

        ArrayList<String> list1 = new ArrayList<>();
        list1.add("123");
        list1.add("456");

        ArrayList<Integer> list2 = new ArrayList<>();
        list2.add(789);
        list2.add(234);
        read(list1);
        read(list2);
    }

    public static void read(Collection<?> collection) {
        for (Object o : collection) {
            System.out.println(o);
        }
    }
}
